package com.ayf.payment.game.api.service.platform.impl;

import com.ayf.payment.game.api.entity.platform.WxGatewayAddress;
import com.ayf.payment.game.api.entity.platform.WxGatewayMerchant;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.ayf.payment.game.api.mapper.platform.WxGatewayMerchantMapper;
import com.ayf.payment.game.api.service.platform.WxGatewayMerchantService;
import tk.mybatis.mapper.entity.Example;

@Service
public class WxGatewayMerchantServiceImpl implements WxGatewayMerchantService{

    @Resource
    private WxGatewayMerchantMapper wxGatewayMerchantMapper;

    @Override
    public boolean inster(WxGatewayMerchant wxGatewayMerchant) {


        return wxGatewayMerchantMapper.insert(wxGatewayMerchant)>0;
    }

    @Override
    public WxGatewayMerchant getWxGatewayMerchant(Integer merchantId, String wxOriginId) {
        Example example = new Example(WxGatewayMerchant.class);
        example.createCriteria().andEqualTo("wxOriginId",wxOriginId).andEqualTo("merchantId",merchantId);

        return wxGatewayMerchantMapper.selectOneByExample(example);
    }
}
